FROM debian:latest

RUN apt-get update -y \
  && apt-get upgrade -y \
  && apt-get install -y wget nano

COPY ./add-gnucobol-3-2.sh /tmp/add-gnucobol-3-2.sh

RUN /tmp/add-gnucobol-3-2.sh

ARG COB_LIBRARY_PATH=/usr/local/lib
ENV COB_LIBRARY_PATH=${COB_LIBRARY_PATH}
ARG COB_PRE_LOAD=libocsql
ENV COB_PRE_LOAD=${COB_PRE_LOAD}

ARG PUID=1000
ENV PUID ${PUID}
ARG PGID=1000
ENV PGID ${PGID}

RUN groupadd -g ${PGID} valerio && \
    useradd -l -u ${PUID} -g valerio -m valerio && \
    usermod -p "*" valerio -s /bin/bash

USER valerio

# questa deve coincidere con il valore di CONTAINER_PATH
RUN mkdir /home/valerio/gnucobol32
